package com.yeyks.activity.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yeyks.activity.dal.dao.ActivityListMapper;
import com.yeyks.activity.dal.domain.ActivityList;
import com.yeyks.activity.service.ActivityListService;
import org.springframework.stereotype.Service;


/**
 * <p>
 * 活动列表 服务实现类
 * </p>
 *
 * @author shuai
 * @since 2019-11-28
 */
@Service
public class ActivityListServiceImpl extends ServiceImpl<ActivityListMapper, ActivityList> implements ActivityListService {

    @Override
    public ActivityList getActivityListByActivityCode(String activityCode) {
        return getOne(
                new QueryWrapper<ActivityList>()
                        .eq(ActivityList.ACTIVITY_CODE, activityCode)
                        .eq(ActivityList.STATUS, 1)
                        .last("limit 1")
        );
    }

}
